import axios from 'axios'
import * as constant from './constant'

const getData = (result) =>({
  type: constant.GET_DETAIL_DATA,
  autherInfo: result.autherInfo,
  contentInfo: result.contentInfo
})
export const changeDetailData = (id) => {
return (dispatch) => {
    axios.get('/api/detail.json?id=' + id).then((res) => {
        const result = res.data.data;
        dispatch(getData(result))
    })
}
}